import Vue from 'vue'
import App from './App.vue'
import axios from 'axios';
import ElementUI from 'element-ui';
import VueRouter from 'vue-router';
// import Homework from './components/Homework.vue';
import 'element-ui/lib/theme-chalk/index.css';
import store from './store/index.js';
import Cardcs from './components/cardcs.vue'
import Coursedet from './components/coursedet.vue'
import Studentlist from './components/Studentlist.vue'
import Login from './components/login.vue'
import Choose from './components/choose.vue'
import Homework from './components/Homework.vue'
import Topic from './components/topic.vue'
import Header from './components/Header.vue'
import Notice from './components/notice.vue'
import Teacher_topic from './components/teacher_topic.vue'
import Release from './components/release.vue'
import Stu_notice from'./components/Stu_notice.vue'
import Noticeinfo from './components/noticeinfo.vue'
import Judge from './components/judge.vue'
import Programmer from './components/programmer.vue'
import  Class from './components/class.vue'
import Student from './components/student.vue'
import Ceshi from './components/ceshi.vue'
import Ceshi1 from './components/ceshi1.vue'
import Ceshi2 from './components/ceshi2.vue'
import VueCookies from 'vue-cookies'
import Ceshi3 from './components/ceshi3.vue'
Vue.use(VueCookies)
Vue.use(VueRouter);
let router = new VueRouter({
  mode: 'history',
  routes: [

    {
      path: '/',
      component: Login,
    },
    {
      path: '/cardcs',
      component: Cardcs,
    },
    {
      path: '/studentlist',
      component: Studentlist,
    },
    {
      path: '/coursedet',
      component: Coursedet,
    },
    
    {
      path: '/choose',
      component: Choose,
    },
    {
      path: '/homework',
      component: Homework,
    },
    {
      path: '/topic',
      component: Topic,
    },
    {
      path: '/header',
      component: Header,
    },
   
    {
      path: '/teacher_topic',
      component: Teacher_topic,
    },
    {
      path: '/notice',
      component: Notice,
    },
    {
      path: '/release',
      component: Release,
    },
    {
      path: '/stunotice',
      component: Stu_notice,
    },
    {
      path: '/noticeinfo',
      component: Noticeinfo,
      name:'noticeinfo'
    },
    {
      path: '/judge',
      component: Judge,
      
    },
    {
      path: '/programmer',
      component: Programmer,
    },
    {
      path: '/class',
      component: Class,
    },
    {
      path: '/student',
      component: Student,
    },
    {
      path: '/ceshi',
      component: Ceshi,
    },
    {
      path: '/ceshi1',
      component: Ceshi1,
      },
    {
      path: '/ceshi2',
      component: Ceshi2,
      },
    {
      path: '/ceshi3',
      component: Ceshi3,
    },
  ]
})
Vue.prototype.$axios = axios;
Vue.config.productionTip = false
Vue.use(ElementUI);
// router.beforeEach(function (to, from, next) {
//   var logged_in = false
//   var logged = window.localStorage.getItem('flag')
//   if (logged == 'true') {
//     logged_in = true
//   }
//   if (!logged_in && to.matched.some(function (item) {
//     return item.meta.login_required
//   })) {
//     next('/login');
//   } else {
//     next();
//   }
// });
new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
